<!DOCTYPE html>
<html lang="en">

<head>
  <meta charset="UTF-8">
  <meta name="viewport" content="width=device-width, initial-scale=1.0">
  <title>Number的静态方法</title>
</head>

<body>
  <script>
    // toFixed保留几位小数(四舍五入)
    const num = 10.222
    console.log(num.toFixed(2));
  </script>
</body>

</html>